UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qyJfAwL9iH3iBnD+OrBK0zZRhGoaOLSFzNHvl9ogsGI='
WHERE
key_id = 'ac0704a6a36155ea4d09d707eaca65acc35ebfef752c9286f22c5587d5cb3ed3'
AND (
token = 'qyJfAwL9iH3iBnD+OrBK0zZRhGoaOLSFzNHvl9ogsGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)