UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L6so3OGXV5FOOletwRYVg8BoonQe+mCmJMvP+jN66QA='
WHERE
key_id = '7c844240ff842ef16b946cdae2f6fd8d654480d369e9edf81c0ade59b6f2e1db'
AND (
token = 'L6so3OGXV5FOOletwRYVg8BoonQe+mCmJMvP+jN66QA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)