UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NFxog0AuDUy8XB2uM0DADaLuZZuHAC3KlJxxwtyKUOY='
WHERE
key_id = '3d44f93b50b4e92759c146464fc265b4943efcb1c063f4099ce058c79a972ecb'
AND (
token = 'NFxog0AuDUy8XB2uM0DADaLuZZuHAC3KlJxxwtyKUOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)