UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAS4R+lRrdf+1xWgv3bPgMuK9ydjdL5a6nsm3GSqZQU='
WHERE
key_id = 'f14beda2fcf582218cd5a21f9e5107196246dd4af11f47a2306936f2b03c6eba'
AND (
token = 'yAS4R+lRrdf+1xWgv3bPgMuK9ydjdL5a6nsm3GSqZQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)