UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2rw/CV2YrtwUsleup9Ez4+N8nO5a0UGzii+dH64qyMs='
WHERE
key_id = '93ce4c7d22b3b63920bc2350a72b79c6f702039bf831bed1840b27f21c689da5'
AND (
token = '2rw/CV2YrtwUsleup9Ez4+N8nO5a0UGzii+dH64qyMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)