UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Q5pZodKBKEVSnZspmCjWlBp22av+C7PSghQEFCMFIA=' 
WHERE 
  key_id = '1e14566e06902d8e6bd84198d3bdbc69a71c78e1051044551a7d6726412e6412' 
  AND (
    token = '+Q5pZodKBKEVSnZspmCjWlBp22av+C7PSghQEFCMFIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041