UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wbq0ILbQF+0BqWn/REqVOzNkjcw5pNGNPvu6a8kLrG4=' 
WHERE 
  key_id = '7adfb14944bd1b9fb1a1e40b99d5b7f8749c883b9f3b5b2f37333c966cd2209d' 
  AND (
    token = 'Wbq0ILbQF+0BqWn/REqVOzNkjcw5pNGNPvu6a8kLrG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036