UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QnqFIx3IeiYMD4eRNqLN02PgQYVVeHixQOOvD0jF75g='
WHERE
key_id = 'dd079bb06396fc933ec44d9ebaf8f3611a3db553a5694ef1f87f5fdc9c82b656'
AND (
token = 'QnqFIx3IeiYMD4eRNqLN02PgQYVVeHixQOOvD0jF75g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)