UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jMbAQD5cRO8PwZPF08sq9Lqcf0uL+6o5MwPYYCepHy8='
WHERE
key_id = '358733001d5782fd620b6dc5097a8c536a249662be9616df2c5afc1cf92c4003'
AND (
token = 'jMbAQD5cRO8PwZPF08sq9Lqcf0uL+6o5MwPYYCepHy8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)