UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't4HlZ5w/BjusbvPy1bCh2MQmgGPa8xxG/habRdeeQO0='
WHERE
key_id = '956eea4849008b716fdbe89dda24dc334229f4fe76777b9ac936a1a99df869a2'
AND (
token = 't4HlZ5w/BjusbvPy1bCh2MQmgGPa8xxG/habRdeeQO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)