UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'spA917aRSrnvC67F4P763dAVY5jjzq/GJpHhEtQqZ0I='
WHERE
key_id = 'c71ce1422bd3b07193c33b6b9f0ffc9de601ccf05e9f9b8f72ef1d9ede6f848f'
AND (
token = 'spA917aRSrnvC67F4P763dAVY5jjzq/GJpHhEtQqZ0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)