UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Nqv3hDGt2WpqsnccQKaCWgF+JV+7MVHWO/cqUctfqo='
WHERE
key_id = 'f053c640828a166b3fe43f9fcfad143c39927c87ca3717a424b2a701e8ed7a38'
AND (
token = '3Nqv3hDGt2WpqsnccQKaCWgF+JV+7MVHWO/cqUctfqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)