UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FnYgP/ioHMqYxoq1jO+wCUG9NRw1htt9cazv300W3PY='
WHERE
key_id = 'a20423e09ed13ee5ed2cb312b673732d38078718181fb239a3b7b8c2ec9937bf'
AND (
token = 'FnYgP/ioHMqYxoq1jO+wCUG9NRw1htt9cazv300W3PY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)