UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+WumTtEW1+hdACjIWc774D1o5JvetPMUseu5+pU5ifY=' 
WHERE 
  key_id = 'ce0fbf894de0bbdecf8af5ab0fd4754dcb4be79fa52600f5219c8f2e8b9e3d4a' 
  AND (
    token = '+WumTtEW1+hdACjIWc774D1o5JvetPMUseu5+pU5ifY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014