UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ksN+AGbsBgEITw7R80GmdjI8hBVLgo3WWh0VKWYGCcc='
WHERE
key_id = '619fa3216e6067f33548d4f2b8e2c69173df765f5cfaea907557751d0c713b70'
AND (
token = 'ksN+AGbsBgEITw7R80GmdjI8hBVLgo3WWh0VKWYGCcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)