UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ViOovU0h06bN9pG7K6kLI/ZGH40sNW/1KSxg3wiX0N4=' 
WHERE 
  key_id = '68634d01752089753a455aefaf1fbe58e61b0f7712c524950f90f5f71317f8d6' 
  AND (
    token = 'ViOovU0h06bN9pG7K6kLI/ZGH40sNW/1KSxg3wiX0N4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048