UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7JUul6gwkl6sN74L/X81YyIC0DxNpa4xOE/SgwlpnLM=' 
WHERE 
  key_id = '3334fc29e13390a9fc1c116fe6d44cb3c5f10bc99b5ed797ff6672f7f0b11d84' 
  AND (
    token = '7JUul6gwkl6sN74L/X81YyIC0DxNpa4xOE/SgwlpnLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019