UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V4pCtpSLgTYNLKXIHY6Ug1/J1TWaf9OmqqSTfclYDqM='
WHERE
key_id = 'aad8e52754c5625cc8f7994a796d19c2004209fbae11cef0cce380fff088e622'
AND (
token = 'V4pCtpSLgTYNLKXIHY6Ug1/J1TWaf9OmqqSTfclYDqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)