UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+w7RvkJKkAcYXwsqqazUDxkpu9+FDxb6FaqTsc7zKPQ=' 
WHERE 
  key_id = '7b4cf43e3a2835811d78d7d3231af991bafbcfc64d0c61c33b20a641a6a233a5' 
  AND (
    token = '+w7RvkJKkAcYXwsqqazUDxkpu9+FDxb6FaqTsc7zKPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034