UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xjIx/E0UrW0eTcYI0d2TClHUwr+pg7S0jOZVAfYTkUw='
WHERE
key_id = '5019640e3f0fda53cea9c03870f5967208446ca3ee9dfade01d725af979b3e0c'
AND (
token = 'xjIx/E0UrW0eTcYI0d2TClHUwr+pg7S0jOZVAfYTkUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)