UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NyM9os/8o4rpJ998EXI2InFWcV4xpdK9Up2yViEcfZI=' 
WHERE 
  key_id = '33bbdf937599750ee21468784d2431a9ef97241971ce94ab6417fcce851f149f' 
  AND (
    token = 'NyM9os/8o4rpJ998EXI2InFWcV4xpdK9Up2yViEcfZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036