UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iKVxc070yeZT3tkaYC0MNgIfXoYqLNnIb/KMl5mXYBc='
WHERE
key_id = '4d609cd63eaf066b3b926b3d2baf2efe1d11824b6124f0180747a4520a3a31fc'
AND (
token = 'iKVxc070yeZT3tkaYC0MNgIfXoYqLNnIb/KMl5mXYBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)