UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ALssQ6sXLXM3NPpM+h/IxtMvfu/gM8nOO27nc1Aecys='
WHERE
key_id = '760641e1b99705a80de7376dac8e03eff70a72c2f55432a193c9b45034f67823'
AND (
token = 'ALssQ6sXLXM3NPpM+h/IxtMvfu/gM8nOO27nc1Aecys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)