UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TemEmfhBy2e9MN17IMXvowhPiy4PTN7ozfG1bGvbeQI=' 
WHERE 
  key_id = '1df1bd2063426fc91c71f1892b5d4c7095f563c1f7a79cbec82e9cf3a330780b' 
  AND (
    token = 'TemEmfhBy2e9MN17IMXvowhPiy4PTN7ozfG1bGvbeQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018