UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6l7uslnVoBlSZTQDSac5+w3isIDOuQEuljZBa3pIXd8=' 
WHERE 
  key_id = '133359a4e8723d67652d68d3852cf9149aa282eb330ecdf699f76292d27cadcf' 
  AND (
    token = '6l7uslnVoBlSZTQDSac5+w3isIDOuQEuljZBa3pIXd8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047