UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FIyPT7ClDlB1aPWF69Hf/79ESC8xgUJYicQgrSvdO/E='
WHERE
key_id = 'f8eeb776ba00a72b14446a3ed7219f2c4b517d3a86df3b273f99fb6b42a79f1c'
AND (
token = 'FIyPT7ClDlB1aPWF69Hf/79ESC8xgUJYicQgrSvdO/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)