UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H/gl05Wh7I/gOk88FTgEoc69jtUhzhe8y8nZO5rWzXA=' 
WHERE 
  key_id = '305df4d9ebdc8280af9215f99210c7b85107f7c49427c6423925d1200c92c3d4' 
  AND (
    token = 'H/gl05Wh7I/gOk88FTgEoc69jtUhzhe8y8nZO5rWzXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032