UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'suTZxp7s2nUVoYcXpzFuxvkrIDJG5elGGRk2an3UAz4='
WHERE
key_id = '1ac90a92ea2b56dc9724a568b399ed315b6792e17c042cd45c19a5fbcbe4136a'
AND (
token = 'suTZxp7s2nUVoYcXpzFuxvkrIDJG5elGGRk2an3UAz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)