UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oe5BFJKSR+6HdwrDzsEB8P/SKGZ1io3o0mI+WkclQfI=' 
WHERE 
  key_id = '6ef9f0769563cde89473ab6d6eb86442d1bda366d6a8acf2b0ed37905b83d6ac' 
  AND (
    token = 'Oe5BFJKSR+6HdwrDzsEB8P/SKGZ1io3o0mI+WkclQfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042