UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a3YpumlPNmazZTlHg2YlIqMq6mhp+Y3Y9maLhkdnNa8=' 
WHERE 
  key_id = 'dfe0000b24ea0b25c9de80d90e15190f23e53196fa38166722b9bddf072bf2bf' 
  AND (
    token = 'a3YpumlPNmazZTlHg2YlIqMq6mhp+Y3Y9maLhkdnNa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018