UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't6V/d0RHaO8s3JBRs/HwLcnZoPSjR/OCK9trp6dLHWE=' 
WHERE 
  key_id = 'df7011630c51af32ee26083eb316d3c251602ba14a3e177ba442ca0cca9c58be' 
  AND (
    token = 't6V/d0RHaO8s3JBRs/HwLcnZoPSjR/OCK9trp6dLHWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039