UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xMC51OY4l5nX/x7VMRx3REXDgr0ShGOC29awDSRXNQk=' 
WHERE 
  key_id = '91c17d65a7cde3436272176629da9c4bc6d1ac43cf31559310f40e89a036ff9f' 
  AND (
    token = 'xMC51OY4l5nX/x7VMRx3REXDgr0ShGOC29awDSRXNQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022